#include <iostream>
#include <map>
using namespace std;
int main()
{
    int n;
    map<int,int> mp;
    cin >> n;
    for (int i = 0;i < n;i++) {
        int x;
        cin >> x;
        if (mp.find(x) == mp.end()) {
            mp[x] = i;
        } else {
            cout << mp[x] << " " << i << endl;
        }
    }
}